<title>招投标管理-增加</title>
<!-- /section:settings.box -->
<div class="row">
	<div class="col-xs-12 bidding_add">
		<form class="form-horizontal registerform">
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">招标项目：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_p_name"
							id="hx_p_name" value="" datatype="*" nullmsg="请输入招标项目"
							placeholder="请输入招标项目">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<!-- 
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">招标分类：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<select datatype="*" id="hx_b_type" nullmsg="请选择招标分类">
							<option>请选择招标分类</option>
							<?php
							var_dump ( $category );
							if (is_array ( $category ) && count ( $category ) > 0) {
								foreach ( $category as $item ) {
									?>
									<option value="<?=$item['id']?>"><?=$item['sys_value']?></option>
									<?php
								}
							}
							?>
						</select>
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div> -->
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">招标方式：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<select datatype="*" nullmsg="请选择招标方式" id="hx_bidding_types">
							<option>请选择招标方式</option>
							<option value="公开招标">公开招标</option>
							<option value="邀请招标">邀请招标</option>
						</select>
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">是否城重项目：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<select datatype="*" nullmsg="请选择是否城重项目" id="hx_repetition">
							<option>请选择是否城重项目</option>
							<option>是</option>
							<option>否</option>
						</select>
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">建设单位：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" datatype="*"
							id="hx_organization" nullmsg="请输入建设单位" placeholder="请输入建设单位">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">投资额：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" datatype="*" name="hx_investment" value=""
							id="hx_investment" nullmsg="请输入建设单位" placeholder="请输入建设单位">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">招标代理机构：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_agency" value="" datatype="*"
							id="hx_agency" nullmsg="请输入招标代理机构" placeholder="请输入招标代理机构">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">备案时间：</label>
				<div data-link-field="dtp_input1" data-date-format="yyyy-mm-dd"
					class="input-group date form_datetime col-sm-2 fl">
					<input type="text" id="hx_record_time" size="16"
						class="form-control col-sm-12" placeholder="请选择申请日期"> <span
						class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
					<span class="input-group-addon"><span
						class="glyphicon glyphicon-th"></span></span>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">资审时间：</label>
				<div data-link-field="dtp_input1" data-date-format="yyyy-mm-dd"
					class="input-group date form_datetime col-sm-2 fl">
					<input type="text" id="hx_q_time" size="16"
						class="form-control col-sm-12" placeholder="请选择申请日期"> <span
						class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
					<span class="input-group-addon"><span
						class="glyphicon glyphicon-th"></span></span>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">开标时间：</label>
				<div data-link-field="dtp_input1" data-date-format="yyyy-mm-dd"
					class="input-group date form_datetime col-sm-2 fl">
					<input type="text" id="hx_opentime" size="16"
						class="form-control col-sm-12" placeholder="请选择申请日期"> <span
						class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
					<span class="input-group-addon"><span
						class="glyphicon glyphicon-th"></span></span>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">开标地点：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" datatype="*" name="hx_openaddress" value="" 
							id="hx_openaddress" nullmsg="请输入开标地点" placeholder="请输入开标地点">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">开标单位：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" datatype="*" name="hx_openunit" value="" 
							id="hx_openunit" nullmsg="请输入开标地点" placeholder="请输入开标地点">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">中标价：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" datatype="*" name="hx_biddingprice" value="" 
							id="hx_biddingprice" nullmsg="请输入开标地点" placeholder="请输入开标地点">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">项目经理：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<input type="text" class="input-xlarge" name="hx_project_manager"
							id="hx_project_manager" value="" datatype="*" nullmsg="请输入项目经理"
							placeholder="请输入经办人">
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>

			<div class="space-4"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label no-padding-right"
					for="form-field-name">备注：</label>
				<div class="input-group col-sm-9">
					<div class="in_txt">
						<textarea class="input-xlarge" datatype="*" nullmsg="请输入备注"
							id="hx_remark" placeholder="请输入备注" style="min-height: 80px;"></textarea>
					</div>
					<div class="tishi">
						<div class="Validform_checktip"></div>
					</div>
				</div>
			</div>
			<div class="space-4"></div>
			<div class="clearfix form-actions">
				<div class="col-md-offset-3 col-md-9">
					<button class="btn btn-info save" type="button" id="btnSubmit">
						<i class="ace-icon fa fa-check bigger-110"></i>增加
					</button>
					&nbsp; &nbsp;
					<button class="btn" type="button">
						<i class="ace-icon glyphicon glyphicon-remove bigger-110"></i>取消
					</button>
				</div>
			</div>
		</form>
	</div>
	<!-- PAGE CONTENT ENDS -->
	<!-- /.col -->
</div>
<script type="text/javascript">
var scripts = [null, "/datetimepicker/js/bootstrap-datetimepicker.min.js",
		   	"/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js", null];
var $scope = $(".bidding_add");
$('.page-content-area').ace_ajax('loadScripts', scripts, function() {
	$('.js_nav_a li.open').removeClass('open')
	$('.js_nav_a li.active').removeClass('active')
	var vform= $(".registerform").Validform({
		tiptype:2
	});			
	$('.form_datetime').datetimepicker({
				minView: "month", //选择日期后，不会再跳转去选择时分秒 
				format: "yyyy-mm-dd", //选择日期后，文本框显示的日期格式 
				language: 'zh-CN', //汉化 
				autoclose:true //选择日期后自动关闭 
			});
	$("#btnSubmit").click(function(){	
		if(!vform.check(false))
		{
			return;	
		}							
		var p_name = $("#hx_p_name",$scope).val();//招标项目
		//var b_type = $("#hx_b_type",$scope).val();//招标分类
		var bidding_types = $("#hx_bidding_types",$scope).val();//招标方式	
		var repetition = $("#hx_repetition",$scope).val();//是否重建项目
		var organization = $("#hx_organization",$scope).val();//建设单位
		var agency = $("#hx_agency",$scope).val();
		var openaddress = $("#hx_openaddress",$scope).val();
 		var	agent = $("#hx_agent",$scope).val();
 		var remark = $("#hx_remark",$scope).val();
 		var  record_time = $("#hx_record_time").val();
 		var q_time = $("#hx_q_time").val();
 		var opentime = $("#hx_opentime").val();
 		var project_manager= $("#hx_project_manager").val();
 		var biddingprice = $("#hx_biddingprice").val();
 		var investment = $("#hx_investment").val();
 		var openunit = $("#hx_openunit").val();
		$.post('/bidding/Ajax_bidding_add',{
			'p_name':p_name,
			//'b_type':b_type,
			'bidding_types':bidding_types,
			'repetition':repetition,
			'organization':organization,
			'agency':agency,
			'openaddress':openaddress,
			'agent':agent,
			'remark':remark,
			'q_time':q_time,
			'record_time':record_time,
			'opentime':opentime,
			'project_manager':project_manager,
			'biddingprice':biddingprice,
			'openunit':openunit,
			'investment':investment
			},function(data){
			if(200===data.status)
			{
				message_box.show('添加招投标管理成功');
				location.href="/#bidding/list";						
			}else
			{
			  message_box.show(data.data);
			}
			 
		},'json');
	});			
})
</script>
